package com.zkld.frame.filter;

import org.springframework.context.annotation.Configuration;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @program: frame
 * @description:
 * @author: JD
 * @create: 2019-07-04 11:06
 **/
@WebFilter("/*")
@Configuration
public class MyFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("---------------------SpringBoot 使用Filter需加@Configuration才生效---------------------------------");
        chain.doFilter(request,response);
    }

    @Override
    public void destroy() {

    }
}
